home *** CD-ROM | disk | FTP | other *** search
/ Revista do CD-ROM 101 / CD-ROM 101.iso / compl / maya5ple / Install_MayaPLE5_English.exe / Maya / Data1.cab / attachSrfToolScript.mel < prev    next >
Encoding:
Text File  |  2003-07-17  |  3.7 KB  |  127 lines

  1. // Copyright (C) 1997-2002 Alias|Wavefront,
  2. // a division of Silicon Graphics Limited.
  3. //
  4. // The information in this file is provided for the exclusive use of the
  5. // licensees of Alias|Wavefront.  Such users have the right to use, modify,
  6. // and incorporate this code into other products for purposes authorized
  7. // by the Alias|Wavefront license agreement, without fee.
  8. //
  9. // ALIAS|WAVEFRONT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
  10. // INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
  11. // EVENT SHALL ALIAS|WAVEFRONT BE LIABLE FOR ANY SPECIAL, INDIRECT OR
  12. // CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
  13. // DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
  14. // TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  15. // PERFORMANCE OF THIS SOFTWARE.
  16. //
  17. //
  18. // Alias|Wavefront Script File
  19. // MODIFY THIS AT YOUR OWN RISK
  20. //
  21. // Creation Date:  5 January 1999
  22. // Author:         sw
  23. //
  24. //
  25. //  Procedure Name:
  26. //      alignCurvesToolScript
  27. //
  28. //  Description:
  29. //    create wrapper around the alignCurve command
  30. //
  31. //  Input Arguments:
  32. //      what is going to happen when this script is called
  33. //        $setToTool = 0 ==> do the command
  34. //        $setToTool = 1 ==> show option box
  35. //        $setToTool = 2 ==> return the command
  36. //        $setToTool = 3 ==> show tool option box
  37. //        $setToTool = 4 ==> enter the tool
  38. //
  39. //  Return Value:
  40. //      None.
  41. //
  42.  
  43. global proc attachSrfToolSetup( int $forceFactorySettings, string $goToTool )
  44. {
  45.     global int $gStartWithAutoComplete;
  46.     if( $forceFactorySettings || !`optionVar -ex attachSurfaceEuc` ) {
  47.         optionVar -iv attachSurfaceEuc 0;
  48.     }
  49.     if( $forceFactorySettings || !`optionVar -ex attachSurfaceLac` ) {
  50.         optionVar -iv attachSurfaceLac $gStartWithAutoComplete;
  51.     }
  52.     if( "" != $goToTool ) {
  53.         scriptCtx -e -euc `optionVar -q attachSurfaceEuc` $goToTool;
  54.         scriptCtx -e -lac `optionVar -q attachSurfaceLac` $goToTool;
  55.     }
  56. }
  57.  
  58. global proc attachSurfaceValues ( string $toolName ) 
  59. {
  60.     performAttachSrf 3 $toolName;
  61.     scriptCtxCommonValues( $toolName );
  62. }
  63.  
  64. global proc attachSurfaceProperties()
  65. {
  66.     scriptCtxCommonProperties;
  67. }
  68.  
  69. proc createAttachSrfContext ( string $tool )
  70. {
  71.     if( ! `scriptCtx -exists $tool` ) {
  72.         attachSrfToolSetup( 0, "" );
  73.         scriptCtx
  74.             -i1 "align.xpm"
  75.             -bcn "attachSurface"
  76.  
  77.             -title "Attach Surfaces Tool"
  78.             -totalSelectionSets 1
  79.             -expandSelectionList true
  80.             -fcs ("attachSrfToolScript 0")
  81.  
  82.             -setNoSelectionPrompt ("Select two surfaces or isoparms " +
  83.                                    "to be attached")
  84.             -setSelectionPrompt ("Select the second surface or isoparm " +
  85.                                  "to attach.")
  86.             -setDoneSelectionPrompt ("Press ENTER to attach surfaces.")
  87.  
  88.             -setAutoToggleSelection true
  89.             -showManipulators true
  90.             -nurbsSurface true
  91.             -isoparm true
  92.                -surfaceEdge true
  93.                -polymeshEdge true
  94.  
  95.             -setAutoComplete `optionVar -q attachSurfaceLac`
  96.             -setSelectionCount 2
  97.  
  98.             // If this was true, the tool would exit
  99.             // once the attach has been completed
  100.             -exitUponCompletion `optionVar -q attachSurfaceEuc`
  101.  
  102.         $tool;
  103.     }
  104. }
  105.  
  106. global proc string attachSrfToolScript( int $setToTool )
  107. //
  108. //    Description :
  109. //        $setToTool = 0 ==> do the command
  110. //        $setToTool = 1 ==> show option box
  111. //        $setToTool = 2 ==> return the command
  112. //        $setToTool = 3 ==> show tool/action option box
  113. //        $setToTool = 4 ==> enter the tool/do the action
  114. {
  115.     string $tool = "";
  116.     if( $setToTool > 2 ) {
  117.         if( !`optionVar -q modelWithToolAttachSurface` ) {
  118.             $setToTool = 4 - $setToTool;
  119.         }
  120.         else {
  121.             $tool = "attachSrfContext";
  122.             createAttachSrfContext $tool;
  123.         }
  124.     }
  125.     return scriptToolScript( "performAttachSrf", $setToTool, $tool );
  126. }
  127.